﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Simulacion.Fruits
{
    public class Nopal : Fruit
    {
        private double pLowA, pLowB, pLowC, pJulA, pJulB, pHighA, pHighB;

        public Nopal()
        {
            _life = 3;
            this.pLowA = 0;
            this.pLowB = 0;
            this.pLowC = 4.7775;
            this.pJulA = 0;
            this.pJulB = 3.6915;
            this.pHighA = 0.61479;
            this.pHighB = 3.8852;

            this._pLowMin = pLowA;
            this._pLowMax = pLowC;
            this._pHighMin = pHighA;
            this._pHighMax = pHighB;
            this._pJulMin = pJulA;
            this._pJulMax = pJulB;
        }

        protected override double GetVarPeriodLow()
        {
            return Distributions.Triangular.GetDistributionValue(pLowA, pLowB, pLowC);
        }

        protected override double GetVarPeriodHigh()
        {
            return Distributions.Uniform.GetDistributionValue(pHighA, pHighB);
        }

        protected override double GetVarPeriodJuly()
        {
            return Distributions.Uniform.GetDistributionValue(pJulA, pJulB);
        }

        protected override double GetFPeriodLow(double x)
        {
            return Distributions.Triangular.fTriangular(x, pLowA, pLowB, pLowC);
        }

        protected override double GetFPeriodHigh(double x)
        {
            return Distributions.Uniform.fUniform(pHighA, pHighB);
        }

        protected override double GetFPeriodJuly(double x)
        {
            return Distributions.Uniform.fUniform(pJulA, pJulB);
        }

        public double PLowA
        {
            get { return pLowA; }
            set { pLowA = value; }
        }

        public double PLowB
        {
            get { return pLowB; }
            set { pLowB = value; }
        }

        public double PLowC
        {
            get { return pLowC; }
            set { pLowC = value; }
        }

        public double PJulA
        {
            get { return pJulA; }
            set { pJulA = value; }
        }

        public double PJulB
        {
            get { return pJulB; }
            set { pJulB = value; }
        }

        public double PHighA
        {
            get { return pHighA; }
            set { pHighA = value; }
        }

        public double PHighB
        {
            get { return pHighB; }
            set { pHighB = value; }
        }
    }
}
